package com.cc.demo.component;

import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
import com.aizuda.snailjob.client.model.ExecuteResult;
import com.aizuda.snailjob.common.log.SnailJobLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@JobExecutor(name = "testSnailJobWithAnnotation")
public class TestSnailJobWithAnnotation {
    public ExecuteResult jobExecute(JobArgs jobArgs) {
        log.info("定时任务执行成功.参数值:{}", jobArgs);
        SnailJobLog.LOCAL.info("LOCAL日志.参数值:{}", jobArgs);
        SnailJobLog.REMOTE.info("REMOTE日志.参数值:{}", jobArgs);
        return ExecuteResult.success("测试注解方式的定时任务成功");
    }
}
